describe('pow', function() {
  it('raises to n-th power', function() {
    assert.equal(pow(2,3), 8);
  })
  it('3 raised to power 3 is 27', function() {
    assert.equal(pow(3, 3), 27);
  })
})

describe('pow 函数测试用例', function() {
  function makeTest(x) {
    let expected = x * x * x;
    it(`${x} in the power 3 is ${expected}`, function() {
      assert.equal(pow(x, 3), expected);
    })
  }
  for (let x = 1; x <= 5; x++) {
    makeTest(x);
  }
})

describe('pow test 嵌套分组', function() {
  describe('raises x to power n', function() {
    function makeTest(x) {
      let expected = x * x * x;
      it(`${x} in the power 3 is ${expected}`, function() {
        assert.equal(pow(x, 3), expected);
      })
    }
    for (let x = 1; x <= 5; x++) {
      makeTest(x);
    }
    it('结果不能为NaN for negative n the result is NaN', () => {
      assert.isNaN(pow(2, -1))
    })
    it('指数不能为小数 for non-integer n the result is NaN', () => {
      assert.isNaN(pow(2, 1.5))
    })
  })
  describe('嵌套测试', () => {
    it('嵌套缩进', () => {})
  });

})
